package com.msb.common.util;

import com.msb.common.enums.MobileOperatorEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: lmf
 * @Create: 2025/3/12 10:43
 * @module
 */
public class OperatorUtil {
    private final static Map<String, Integer>  operatorMap = new HashMap<>();

    static {
        MobileOperatorEnum[] operatorEnums = MobileOperatorEnum.values();
        for (MobileOperatorEnum operatorEnum : operatorEnums) {
            operatorMap.put(operatorEnum.getName(), operatorEnum.getCode());
        }
    }

    public static Integer getOperatorCode(String operatorName){
        return operatorMap.get(operatorName);
    }
}
